/*
 * Taken from https://github.com/flukeout/thimble-home
*/

@BASE_Z_INDEX: 100000000;

@font-face {
  font-family: "Fira Medium";
  src: url("https://code.cdn.mozilla.net/fonts/woff/FiraSans-Regular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

@media print {
  .details-bar,
  .collapsed,
  .cleanslate,
  .mouse-mode {
    display: none !important;
  }
}

.details-bar {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  font-family: "Fira Medium", "Helvetica Neue", sans-serif !important;
  z-index: 2000000 !important;

  .remix-project-title,
  .remix-project-meta,
  .remix-project-author {
    color: #2e9961 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .remix-project-title {
    margin: 1px 0 3px !important;
    font-size: 18px !important;
    line-height: 22px !important;
    font-weight: normal !important;
    padding: 0 !important;
  }

  .remix-project-meta {
    font-size: 14px !important;
    line-height: 15px !important;
    opacity: 0.6 !important;

    .remix-project-author {
      color: inherit !important;
      text-decoration: none !important;
    }
  }

  .details-bar-remix-button-wrapper {
    position: absolute !important;
    right: 5px !important;
    top: 5px !important;
    border-radius: 3px !important;
    background: none !important;
    transition: none important;

    .details-bar-remix-button {
      border-radius: 2px !important;
      font-size: 16px !important;
      line-height: 16px !important;
      height: 17px !important;
      display: block !important;
      cursor: pointer !important;
      background: #47ad66 !important;
      box-shadow: 0 2px 0 #417c53 !important;
      position: relative !important;
      padding: 12px 18px 10px !important;
      color: white !important;
      text-align: center !important;
      text-decoration: none !important;

      &:hover {
        background: #4db76d !important;
      }

      &:active {
        background: #369352 !important;
        box-shadow: none !important;
        top: 2px !important;
      }
    }
  }

  &.mouse-mode {
    width: 400px !important;
    top: 6px !important;
    right: 6px !important;
    height: 75px !important;
    background: ghostwhite !important;
    padding: 11px 110px 11px 76px !important;
    box-sizing: border-box !important;
    font-family: "Fira Medium", "Helvetica Neue", sans-serif !important;
    max-width: ~"calc(100% - 12px)" !important;
    transition: width ease-out 0.1s, background ease-out 0.1s !important;
    border: 5px solid rgba(0, 0, 0, 0.15) !important;
    background-clip: padding-box !important;
    border-radius: 3px !important;

    .details-bar-remix-button-wrapper {
      padding: 7px 7px 8px !important;
    }

    .thimble-logo {
      position: absolute !important;
      width: 60px !important;
      background: #2e9961 !important;
      height: ~"calc(100% - 10px)" !important;
      top: 0 !important;
      left: 0 !important;
      display: block !important;
      margin: 5px !important;
      border-radius: 3px !important;

      .icon {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        right: 0 !important;
        background-image: ~"url(thimble-logo.svg)" !important;
        background-position: 16px center !important;
        background-size: 24px !important;
        background-repeat: no-repeat !important;
        transition: transform 0.05s linear !important;
      }

      &:hover .icon {
        transform: scale(1.1) !important;
      }

      &:active {
        background: #28915a !important;

        .icon {
          transform: scale(1) !important;
        }
      }
    }

    .close-details-bar {
      display: none !important;
    }

    &.collapsed {
      width: 112px !important;
      padding: 11px 11px 11px 14px !important;
      box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2) !important;
      box-shadow: none !important;
      text-align: right !important;
      background: none !important;
      border: 5px solid rgba(0, 0, 0, 0) !important;
      transition: width cubic-bezier(0.52, -0.58, 0.595, 1.01) 0.15s, background ease-out 0.1s 0.15s !important;

      .details-bar-remix-button-wrapper {
        border-radius: 3px !important;
        background: rgba(0, 0, 0, 0.2) !important;
        transition: background ease-out 0.2s 0.2s !important;

        .details-bar-remix-button {
          transition: box-shadow ease-out 0.2s 0.2s !important;
          box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3) !important;
        }
      }

      .thimble-logo,
      .remix-project-title,
      .remix-project-meta {
        opacity: 0 !important;
        transition: none !important;
      }
    }
  }

  &.touch-mode {
    bottom: 6px !important;
    top: auto !important;
    right: 6px !important;
    max-width: ~"calc(100% - 12px)" !important;
    background: white !important;
    padding: 15px !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5) !important;

    .details-bar-remix-button-wrapper {
      margin-top: 10px !important;
      position: static !important;
      padding: 0 !important;
      margin-right: 46px !important;
    }

    .thimble-button {
      position: absolute !important;
      border-radius: 30px !important;
      background: rgba(0, 0, 0, 0.2) !important;
      width: 48px !important;
      height: 49px !important;
      padding: 7px !important;
      bottom: 0 !important;
      right: 0 !important;
      display: none !important;
      cursor: pointer !important;

      .icon {
        display: block !important;
        width: 48px !important;
        height: 48px !important;
        border-radius: 50% !important;
        background-color: #47ad66 !important;
        box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3) !important;
        background-image: ~"url(thimble-logo.svg)" !important;
        background-position: center !important;
        background-size: 22px !important;
        background-repeat: no-repeat !important;
        transition: transform 0.05s linear !important;
        cursor: pointer !important;
      }

      &:hover .icon {
        background-color: #4fb86f !important;
      }
    }

    .close-details-bar {
      display: block !important;
      position: absolute !important;
      border-radius: 50% !important;
      bottom: 13px !important;
      right: 10px !important;
      opacity: 0.25 !important;
      cursor: pointer !important;
      width: 42px !important;
      height: 42px !important;
      border: solid 2px #777 !important;
      box-sizing: border-box !important;

      img {
        height: 13px !important;
        width: 13px !important;
        top: 13px !important;
        left: 13px !important;
        cursor: pointer !important;
        position: absolute !important;
      }
    }

    &.collapsed {
      box-shadow: none !important;
      background: none !important;

      .thimble-button {
        display: block !important;
      }

      .details-bar-remix-button-wrapper {
        display: none !important;
      }

      .thimble-logo,
      .remix-project-title,
      .remix-project-meta,
      .close-details-bar,
      .details-bar-remix-button-wrapper {
        display: none;
        opacity: 0 !important;
        transition: none !important;
      }
    }
  }
}

/* move the remix button to the left side for AFrame projects only*/
.a-body .details-bar.touch-mode {
  right: auto !important;
  left: 6px !important;

  .thimble-button {
    left: 0 !important;
  }

  .details-bar-remix-button-wrapper {
    margin-right: auto !important;
    margin-left: 46px !important;
  }

  .close-details-bar {
    left: 10px !important;
  }
}
